package io.io2;

import java.io.*;
import java.util.Scanner;

public class PWDemo2 {
    public static void main(String[] args) throws FileNotFoundException{
        FileOutputStream fileOutputStream = new FileOutputStream("o.txt");
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream);
        BufferedWriter bufferedWriter = new BufferedWriter(outputStreamWriter);
        PrintWriter printWriter = new PrintWriter(bufferedWriter,true);
        System.out.println("请输入");
        Scanner scanner = new Scanner(System.in);
        while (true){
            String next = scanner.next();
            if ("e".equals(next)){
                break;
            }
            printWriter.println(next);
        }
        printWriter.close();


    }
}
